Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Note
We decided to postpone this change to collect information via telemetry. Once all missing specifiers have been corrected, we will enforce them. Follow up work will be completed in @W-16197665@
Caution
This is technically a breaking change. If we have a message somewhere that is missing a specifier, the tokens will no longer be rendered. This is a difficult thing to validate across our codebase. We could do a few things:
sfdx-core
messages
has a length greater than1
This is a solution to prevent tokens from being rendered in a message when a specifier (e.g.
%s
) does not existIf the message does not contain a specifier, node's
util.format
still appends the token to the end (docs)This issue was discovered in
sf whatsnew --help
where the token for the specifier%s
was being rendered at the end of each example. This was happening because themarkdownLoader
automatically splits bulleted lists into arrays.We now check for the presence of a specifier and only format the message if one is present.
BEFORE:
AFTER:
Testing
yarn build
yarn link
cd
to plugin-infoyarn link @salesforce/core
bin/run.js whatsnew --help
What issues does this PR fix or reference?
@W-16188160@